package com.chat.business.controller;

import com.chat.common.vo.R;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wei kunJie
 * @date 2024/4/8 13:59:08
 */
@RestController
@RequestMapping("/business")
public class TestController {
    @Resource
    private RedisTemplate<String,Object> redisTemplate;
    @Value("${config-name}")
    private String configName;
    @GetMapping("/test")
    public R test(){
        return R.succeed("远程调用成功");
    }
    @GetMapping("/testRedis")
    public R testRedis(){
        redisTemplate.opsForValue().set("test-k","test-v");
        return R.succeed(configName);
    }
}
